<div id="tab6" class="tab">
    <div class="tab-labels">
        <div class="xian"></div>
        三者车损失
    </div>
    <div id="div4">
        <form action="">
            <table class="layui-table" id="tabProduct3">
                <tr style="background:#4e73df;color: #fff;" class="ys">
                    <td style="width: 66px;">选择</td>
                    <td>序号</td>
                    <td>车牌号</td>
                    <td>驾驶员</td>
                    <td>性别</td>
                    <td>电话</td>
                    <td>车辆品牌</td>
                    <td>厂牌型号</td>
                    <td>车辆款式</td>
                    <td>车架号</td>
                    <td>发动机号</td>
                    <td>维修厂名称</td>
                    <td>车损</td>
                    <td>汇总</td>
                    <td style="width: 66px;">操作</td>
                </tr>
                {empty name="sanche"}
                <tr>
                    <td><input type="checkbox" style="width: 15px;height: 15px;display: block;" name="id" disabled></td>
                    <td><input type="text" name="xuhao" value="1" readonly></td>
                    <td><input type="text" name="car_num" readonly></td>
                    <td><input type="text" name="car_user" readonly></td>
                    <td><input type="text" name="sex" readonly></td>
                    <td><input type="text" name="phone" readonly></td>
                    <td><input type="text" name="brand" readonly></td>
                    <td><input type="text" name="model" readonly></td>
                    <td><input type="text" name="style" readonly></td>
                    <td><input type="text" name="car_vin" readonly></td>
                    <td><input type="text" name="car_engine" readonly></td>
                    <td><input type="text" name="weixiuchang" readonly></td>
                    <td><input type="text" name="heji" readonly></td>
                    <td><input type="text" name="c_zongji" readonly></td>
                    <td><input type="text" name="sanche_huizong" readonly></td>
                    <td><input type="text" name="status" readonly></td>
                    <td></td>
                </tr>
                {/empty}
                {volist name="sanche" id="sanchess"}
                <tr>
                    <td><input type="checkbox" style="width: 15px;height: 15px;display: block;" name="id"
                               value="{$sanchess.id}" disabled></td>
                    <td><input type="text" name="xuhao" value="{$sanchess.xuhao}" readonly></td>
                    <td><input type="text" name="car_num" value="{$sanchess.car_num}" title="{$sanchess.car_num}"
                               readonly onclick="openDialog({$sanchess.id})"
                               style="text-decoration: underline;color:blue;cursor: pointer;"></td>
                    <td><input type="text" value="{$sanchess.car_user}" name="car_user" readonly></td>
                    <td><input type="text" value="{$sanchess.sex}" name="sex" readonly></td>
                    <td><input type="text" value="{$sanchess.phone}" name="phone" readonly></td>
                    <td><input type="text" value="{$sanchess.brand}" name="brand" readonly></td>
                    <td><input type="text" name="model" value="{$sanchess.model}" readonly></td>
                    <td><input type="text" name="style" value="{$sanchess.style}" readonly></td>
                    <td><input type="text" name="car_vin" value="{$sanchess.car_vin}" readonly></td>
                    <td><input type="text" name="car_engine" value="{$sanchess.car_engine}" readonly></td>
                    <td><input type="text" name="weixiuchang" value="{$sanchess.weixiuchang}" readonly></td>
                    <td><input type="text" name="heji"
                               value="<?php echo floatval($sanchess['p_zongji'])+floatval($sanchess['g_money'])+floatval($sanchess['g_shijiu']);?>"
                               readonly></td>
                    <td><input type="text" name="sanche_huizong" value="{$sanchess.sanche_huizong}" readonly></td>
                    <td>


                    </td>
                </tr>
                {/volist}
            </table>
            <div class="conts" style="display: none">
                <div class="input">
                    <span>车损合计</span>
                    <input type="text" readonly value="{$row.sc_heji}" name="sc_heji" id="sc_heji">
                </div>
                <div class="input">
                    <span>财物合计</span>
                    <input type="text" readonly name="sc_zongji" value="{$row.sc_zongji}" id="sc_zongji">
                </div>
                <div class="input">
                    <span>其他汇总</span>
                    <input type="text" readonly name="sc_huizong" value="{$row.sc_huizong}">
                </div>
                <div class="input">
                    <span>总合计</span>
                    <input type="text" readonly name="z_heji" value="{$row.z_heji}">
                </div>
            </div>
        </form>
    </div>
    <script>
        function test3() {
            var div4 = document.getElementById("div4");
            if (div4.style.display == "block") {
                div4.style.display = "none";
            } else {
                div4.style.display = "block";
            }
        }
    </script>
    <!--<p>汇总</p>-->
    <div id="light" class="white_content">
        <div class="content">
            <!--三者车-->
            <div>
                <form action="">
                    <div class="titles">
                        <p><font></font>三者车定损</p>
                    </div>
                    <input type="hidden" name="bid" value="{$row.id}">
                    <table class="layui-table" id="table">
                        <tr style="background:#4e73df;color: #fff;" class="ys">
                            <td>车牌号</td>
                            <td>车辆品牌</td>
                            <td>车型型号</td>
                            <td>车辆年款</td>
                            <td>车架号</td>
                            <td>发动机号</td>
                            <td>维修厂名称</td>
                            <td>驾驶员</td>
                            <td>性别</td>
                            <td>联系电话</td>
                        </tr>
                        <tr>
                            <td><input type="text" value="" name="car_num" readonly></td>
                            <td><input type="text" value="" name="brand" readonly></td>
                            <td><input type="text" name="model" value="" readonly></td>
                            <td><input type="text" name="style" value="" readonly></td>
                            <td><input type="text" name="car_vin" value="" readonly></td>
                            <td><input type="text" name="car_engine" value="" readonly></td>
                            <td><input type="text" name="weixiuchang" value="" readonly></td>
                            <td><input type="text" value="" name="car_user" readonly></td>
                            <td><input type="text" value="" name="sex" readonly></td>
                            <td><input type="text" value="" name="phone" readonly></td>
                        </tr>
                    </table>
                    <div class="titles">
                        <p><font></font>配件定损</p>
                    </div>
                    <table class="layui-table" id="tabProduct7">
                        <tr style="background:#4e73df;color: #fff;" class="ys">
                            <td style="width: 66px;">选择</td>
                            <td>序号</td>
                            <td>服务种类</td>
                            <td>配件名称</td>
                            <td>价格方案</td>
                            <td>价格</td>
                            <td>数量</td>
                            <td>金额</td>
                            <!-- <td>折扣</td> -->
                            <td>核定价格</td>
                            <td>核定数量</td>
                            <td>核定金额</td>
                            <td>备注</td>
                        </tr>
                        <tr>
                            <td><input type="checkbox" readonly style="width: 15px;height: 15px;display: block;"
                                       name="id" disabled value=""></td>
                            <td><input type="text" name="xuhao" readonly value="1"></td>
                            <!--<td><input type="text" name="type" value="" readonly></td>-->
                            <td><input type="text" name="name" value="" readonly></td>
                            <td><input type="text" name="fangan" value="" readonly></td>
                            <td><input type="text" name="price" value="" readonly></td>
                            <td><input type="text" name="num" value="" readonly></td>
                            <td><input type="text" name="money" value="" readonly></td>
                            <!-- <td><input type="text" name="zhekou" value="100" readonly></td> -->
                            <td><input type="text" name="price_he" value="" readonly></td>
                            <td><input type="text" name="num_he" value="" readonly></td>
                            <td><input type="text" name="hejia" value="" readonly></td>
                            <td><input type="text" name="beizhu" value="" readonly></td>
                        </tr>

                    </table>
                    <table class="layui-table" id="he7">
                        <tr>
                            <td>小计</td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" id="x_money" name="x_money" value="" readonly></td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" id="x_hejia" name="x_hejia" value="" readonly></td>
                            <td><input type="text" readonly></td>

                        </tr>
                    </table>
                    <!--               </form>-->
                    <!--<p>汇总</p>-->
                    <div class="conts">
                        <!-- <div class="input">
                            <span>合计</span>
                            <input type="text" placeholder="合计" id="p_heji" value="" name="p_heji" readonly>
                        </div>
                        <div class="input">
                            <span>残值</span>
                            <input type="text" placeholder="残值" id="canzhi" value="" name="canzhi" readonly>
                        </div>
                        <div class="input">
                            <span>总计</span>
                            <input type="text" placeholder="总计" id="p_zongji" value="" name="p_zongji" readonly>
                        </div> -->
                        <div class="conts">
                            <div class="input">
                                <span>合计</span>
                                <input type="text" placeholder="合计" id="p_heji" value="" name="p_heji" readonly>
                            </div>
                            <div class="input">
                                <span>残值</span>
                                <input type="text" placeholder="残值" id="canzhi" oninput="v()" value="0" name="canzhi"
                                       readonly>
                            </div>
                            <div class="input">
                                <span>配件总计</span>
                                <input type="text" placeholder="总计" id="p_zongji" value="" name="p_zongji" readonly>
                            </div>
                        </div>
                        <div class="conts">
                            <div class="input">
                                <span>核定合计</span>
                                <input readonly type="text" placeholder="核定合计" id="hd_p_heji" value=""
                                       name="hd_p_heji">
                            </div>
                            <div class="input">
                                <span>核定残值</span>
                                <input readonly type="text" placeholder="核定残值" id="hd_canzhi" oninput="v()" value=""
                                       name="hd_canzhi">
                            </div>
                            <div class="input">
                                <span>配件核定总计</span>
                                <input readonly type="text" placeholder="核定总计" id="hd_p_zongji" value=""
                                       name="hd_p_zongji">
                            </div>
                        </div>
                    </div>
                    <div class="titles">
                        <p><font></font>工时核定</p>
                    </div>
                    <table class="layui-table" id="tabProduct8">
                        <tr style="background:#4e73df;color: #fff;" class="ys">
                            <td style="width: 66px;">选择</td>
                            <td>序号</td>
                            <td>服务种类</td>
                            <td>配件名称</td>
                            <td>价格方案</td>
                            <td>价格</td>
                            <td>数量</td>
                            <td>金额</td>
                            <!-- <td>折扣</td> -->
                            <td>核定价格</td>
                            <td>核定数量</td>
                            <td>核定金额</td>
                            <td>备注</td>
                        </tr>
                        <tr>
                            <td><input type="checkbox" style="width: 15px;height: 15px;display: block;" name="id"
                                       value=""></td>
                            <td><input type="text" name="xuhao" readonly value="1"></td>
                            <!--<td><input type="text" name="type" value="" readonly></td>-->
                            <td><input type="text" name="name" value="" readonly></td>
                            <td><input type="text" name="fangan" value="" readonly></td>
                            <td><input type="text" name="price" value="" readonly></td>
                            <td><input type="text" name="num" value="" readonly></td>
                            <td><input type="text" name="money" value="" readonly></td>
                            <!-- <td><input type="text" name="zhekou" value="100" readonly></td> -->
                            <td><input type="text" name="price_he" value="" readonly></td>
                            <td><input type="text" name="num_he" value="" readonly></td>
                            <td><input type="text" name="hejia" value="" readonly></td>
                            <td><input type="text" name="beizhu" value="" readonly></td>
                        </tr>
                    </table>
                    <table class="layui-table" id="he8">
                        <tr>
                            <td>小计</td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" id="g_money" value="" name="g_money" readonly></td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" readonly></td>
                            <td><input type="text" id="g_hejia" value="" name="g_hejia" readonly></td>
                            <td><input type="text" readonly></td>
                        </tr>
                    </table>


                    <div class="conts">
                        <div class="input">
                            <span>施救费</span>
                            <input type="text" placeholder="施救费" id="g_shijiu" oninput="v1s()" value=""
                                   name="g_shijiu" readonly>
                        </div>
                        <div class="input">
                            <span>工时总计</span>
                            <input type="text" placeholder="总计" id="g_zongji" value="" name="g_zongji" readonly>
                        </div>
                    </div>
                    <div class="conts">
                        <div class="input">
                            <span>核定施救费</span>
                            <input readonly type="text" placeholder="核定施救费" id="hd_g_shijiu" oninput="v1s()"
                                   value="" name="hd_g_shijiu">
                        </div>
                        <div class="input">
                            <span>工时核定总计</span>
                            <input readonly type="text" placeholder="核定总计" id="hd_g_zongji" value=""
                                   name="hd_g_zongji">
                        </div>
                    </div>
                    <div class="conts">
                        <div class="input">
                            <span>费用合计</span>
                            <input type="text" placeholder="费用合计" id="heji" name="heji" readonly>
                        </div>
                        <div class="input">
                            <span>核定合计</span>
                            <input readonly type="text" placeholder="核定合计" id="hd_g_heji" value="" name="hd_g_heji">
                        </div>
                    </div>

                    <div class="conts">
                        <div class="input dong">
                            <span>诉讼费</span>
                            <input oninput="jisuan_money3(this)" type="text" id="sanche_susong" name="sanche_susong">
                        </div>
                        <div class="input dong">
                            <span>鉴定费</span>
                            <input oninput="jisuan_money3(this)" type="text" id="sanche_jianding"
                                   name="sanche_jianding">
                        </div>
                        <div class="input dong">
                            <span>公估费</span>
                            <input oninput="jisuan_money3(this)" type="text" id="sanche_gonggu" name="sanche_gonggu">
                        </div>
                        <div class="input dong">
                            <span>住宿费</span>
                            <input oninput="jisuan_money3(this)" type="text" id="sanche_zhusu" name="sanche_zhusu">
                        </div>
                        <div class="input dong">
                            <span>路桥费</span>
                            <input oninput="jisuan_money3(this)" type="text" id="sanche_luqiao" name="sanche_luqiao">
                        </div>
                        <div class="input dong">
                            <span>燃油费</span>
                            <input oninput="jisuan_money3(this)" type="text" id="sanche_ranyou" name="sanche_ranyou">
                        </div>
                        <div class="input dong">
                            <span>其他</span>
                            <input oninput="jisuan_money3(this)" type="text" id="sanche_qita" name="sanche_qita">
                        </div>
                        <div class="input dong">
                            <span>汇总</span>
                            <input type="text" id="sanche_huizong" name="sanche_huizong">
                        </div>
                    </div>
                    <div class="conts">
                        <div class="input dong">
                            <span>诉讼费</span>
                            <input readonly type="text" id="hd_sanche_susong" name="hd_sanche_susong">
                        </div>
                        <div class="input dong">
                            <span>鉴定费</span>
                            <input readonly type="text" id="hd_sanche_jianding" name="hd_sanche_jianding">
                        </div>
                        <div class="input dong">
                            <span>公估费</span>
                            <input readonly type="text" id="hd_sanche_gonggu" name="hd_sanche_gonggu">
                        </div>
                        <div class="input dong">
                            <span>住宿费</span>
                            <input readonly type="text" id="hd_sanche_zhusu" name="hd_sanche_zhusu">
                        </div>
                        <div class="input dong">
                            <span>路桥费</span>
                            <input readonly type="text" id="hd_sanche_luqiao" name="hd_sanche_luqiao">
                        </div>
                        <div class="input dong">
                            <span>燃油费</span>
                            <input readonly type="text" id="hd_sanche_ranyou" name="hd_sanche_ranyou">
                        </div>
                        <div class="input dong">
                            <span>其他</span>
                            <input readonly type="text" id="hd_sanche_qita" name="hd_sanche_qita">
                        </div>
                        <div class="input dong">
                            <span>汇总</span>
                            <input readonly type="text" id="hd_sanche_huizong" name="hd_sanche_huizong">
                        </div>
                    </div>
                    <div class="conts">
                        <span style="width:98%;margin: 1%;">备注说明</span>
                        <textarea name="beizhu" id="beizhu" readonly cols="30" rows="10"
                                  style="width:98%;height: 100px;margin: 1%;"></textarea>
                    </div>
                    <div class="bao" style="display: flex;justify-content: center;">
                        <!--                        <button type="button" onclick = "closeDialogb1666()" style="width:50%;height:100%;border: none;background:#1b4fe7;color: #fff;-webkit-border-radius:5px ;-moz-border-radius:5px ;border-radius: 5px;">保存</button>-->
<!--                        <button type="button" onclick="closeDialog()"-->
<!--                                style="padding: 5px 10px;border: none;background:#1b4fe7;color: #fff;-webkit-border-radius:5px ;-moz-border-radius:5px ;border-radius: 5px;">-->
<!--                            关闭-->
<!--                        </button>-->
                    </div>
                    <!--</div>-->
                </form>
            </div>
        </div>

    </div>
    <div id="fade" class="black_overlay"></div>
    <script type="text/javascript">
        function openDialog(id) {
            // 1. 先打开弹窗（显示加载中状态）
            var $light2Content = $('#light').contents(); // 先保存引用
            var layerIndex = layer.open({
                type: 1,
                title: '加载中...',
                content: `
                    <div style="
                      position: absolute;
                      top: 50%;
                      left: 50%;
                      transform: translate(-50%, -50%);
                      text-align: center;
                    ">
                      <i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>
                      <p style="margin-top: 10px">加载中...</p>
                    </div>
                  `,
                end: function() {
                    // 弹窗关闭时，把内容放回
                    $('#light').append($light2Content);
                },
                area: ['80%', '80%'],
                shadeClose: false // 禁止点击遮罩关闭
            });
            $.ajax({
                url: "{:url('bushen/lisuan/liulan')}",
                data: {id: id},
                type: 'post',
                dataType: 'json',
                success: function (res) {
                    var html = '';
                    if (res.status == true) {
                        html = "<tr>" +
                            "<td><input type='text' readonly name='car_num' value=" + res.data.sanche.car_num + "></td>" +
                            "<td><input type='text' readonly name='brand' value=" + res.data.sanche.brand + "></td>" +
                            "<td><input type='text' readonly name='model' value=" + res.data.sanche.model + "></td>" +
                            "<td><input type='text' readonly name='style' value=" + res.data.sanche.style + "></td>" +
                            "<td><input type='text' readonly name='car_vin' value=" + res.data.sanche.car_vin + "></td>" +
                            "<td><input type='text' readonly name='car_engine' value=" + res.data.sanche.car_engine + "></td>" +
                            "<td><input type='text' readonly name='weixiuchang' value=" + res.data.sanche.weixiuchang + "></td>" +
                            "<td><input type='text' readonly name='car_user' value=" + res.data.sanche.car_user + "></td>" +
                            "<td><input type='text' readonly name='sex' value=" + res.data.sanche.sex + "></td>" +
                            "<td><input type='text' readonly name='phone' value=" + res.data.sanche.phone + "></td>" +
                            "</tr>";
                        $("#table tr").slice(1).remove();
                        $('#table').append(html);
                        var html1 = '';
                        var html2 = '';
                        var html3 = '';
                        if (res.data.sanpei.length > 0) {
                            for (var i = 0; i < res.data.sanpei.length; i++) {
                                html1 += "<tr>" +
                                    "<td><input type='checkbox' style='width: 15px;height: 15px;display: block;' disabled name='id' value=" + res.data.sanpei[i].id + "></td>" +
                                    "<td><input type='text' name='xuhao' readonly value=" + res.data.sanpei[i].xuhao + "></td>" +
                                    "<td><input type='text' name='type' readonly value=" + res.data.sanpei[i].type + "></td>" +
                                    "<td><input type='text' name='name' readonly  value=" + res.data.sanpei[i].name + "></td>" +
                                    "<td><input type='text' name='fangan' readonly value=" + res.data.sanpei[i].fangan + "></td>" +
                                    "<td><input type='text' name='price' readonly value=" + res.data.sanpei[i].price + " ></td>" +
                                    "<td><input type='text' name='num' readonly value=" + res.data.sanpei[i].num + "></td>" +
                                    "<td><input type='text' name='money' readonly  value=" + res.data.sanpei[i].money + "></td>" +
                                    /*"<td><input type='text' name='zhekou' readonly value=" + res.data.sanpei[i].zhekou + "></td>" +*/
                                    "<td><input type='text' name='price_he' readonly  value=" + res.data.sanpei[i].price_he + "></td>" +
                                    "<td><input type='text' name='num_he' readonly  value=" + res.data.sanpei[i].num_he + "></td>" +
                                    "<td><input type='text' name='hejia' readonly  value=" + res.data.sanpei[i].hejia + "></td>" +
                                    "<td><input type='text' name='beizhu' readonly value=" + res.data.sanpei[i].beizhu + "></td>" +
                                    "</tr>";
                            }
                        } else {
                            html1 += "<tr>" +
                                "<td><input type='checkbox' style='width: 15px;height: 15px;display: block;' disabled name='id'></td>" +
                                "<td><input type='text' name='xuhao' value='1' readonly ></td>" +
                                "<td><input type='text' name='type' readonly></td>" +
                                "<td><input type='text' name='name' readonly></td>" +
                                "<td><input type='text' name='fangan' readonly></td>" +
                                "<td><input type='text' name='price' readonly ></td>" +
                                "<td><input type='text' name='num' readonly ></td>" +
                                "<td><input type='text' name='money' readonly ></td>" +
                                /*"<td><input type='text' name='zhekou' readonly ></td>" +*/
                                "<td><input type='text' name='price_he' readonly ></td>" +
                                "<td><input type='text' name='num_he' readonly ></td>" +
                                "<td><input type='text' name='hejia' readonly ></td>" +
                                "<td><input type='text' name='beizhu' readonly ></td>" +
                                "</tr>";
                        }
                        $("#tabProduct7 tr").slice(1).remove();
                        $('#tabProduct7').append(html1);
                        $('#x_money').val(res.data.sanche.x_money);
                        $('#x_hejia').val(res.data.sanche.he_price_pei);
                        $('#p_heji').val(res.data.sanche.p_heji);
                        $('#canzhi').val(res.data.sanche.canzhi);
                        $('#p_zongji').val(res.data.sanche.p_zongji);
                        $("#hd_p_heji").val(res.data.sanche.hd_p_heji);
                        $("#hd_canzhi").val(res.data.sanche.hd_canzhi);
                        $("#hd_p_zongji").val(res.data.sanche.hd_p_zongji);

                        if (res.data.sangong.length > 0) {
                            for (var i = 0; i < res.data.sangong.length; i++) {
                                html2 += "<tr>" +
                                    "<td><input type='checkbox' style='width: 15px;height: 15px;display: block;' disabled name='id'  value=" + res.data.sangong[i].id + "></td>" +
                                    "<td><input type='text' name='xuhao' readonly value=" + res.data.sangong[i].xuhao + "></td>" +
                                    "<td><input type='text' name='type' readonly  value=" + res.data.sangong[i].type + "></td>" +
                                    "<td><input type='text' name='name' readonly  value=" + res.data.sangong[i].name + "></td>" +
                                    "<td><input type='text' name='fangan' readonly  value=" + res.data.sangong[i].fangan + "></td>" +
                                    "<td><input type='text' name='price' readonly value=" + res.data.sangong[i].price + "></td>" +
                                    "<td><input type='text' name='num' readonly value=" + res.data.sangong[i].num + " ></td>" +
                                    "<td><input type='text' name='money' readonly value=" + res.data.sangong[i].money + "></td>" +
                                    /* "<td><input type='text' name='zhekou' readonly value=" + res.data.sangong[i].zhekou + "></td>" +*/
                                    "<td><input type='text' name='price_he' readonly  value=" + res.data.sangong[i].price_he + "></td>" +
                                    "<td><input type='text' name='num_he' readonly  value=" + res.data.sangong[i].num_he + "></td>" +
                                    "<td><input type='text' name='hejia' readonly  value=" + res.data.sangong[i].hejia + "></td>" +
                                    "<td><input type='text' name='beizhu' readonly value=" + res.data.sangong[i].beizhu + "></td>" +
                                    "</tr>";
                            }
                        } else {
                            html2 += "<tr>" +
                                "<td><input type='checkbox' style='width: 15px;height: 15px;display: block;' disabled value='' name='id'></td>" +
                                "<td><input type='text' name='xuhao' value='1' readonly></td>" +
                                "<td><input type='text' name='type' readonly ></td>" +
                                "<td><input type='text' name='name' readonly ></td>" +
                                "<td><input type='text' name='fangan' readonly ></td>" +
                                "<td><input type='text' name='price' readonly ></td>" +
                                "<td><input type='text' name='num' readonly ></td>" +
                                "<td><input type='text' name='money' readonly ></td>" +
                                /* "<td><input type='text' name='zhekou' readonly value='100'></td>" +*/
                                "<td><input type='text' name='price_he' readonly  ></td>" +
                                "<td><input type='text' name='num_he' readonly  ></td>" +
                                "<td><input type='text' name='hejia' readonly  ></td>" +
                                "<td><input type='text' name='beizhu' readonly ></td>" +
                                "</tr>";
                        }
                        $("#tabProduct8 tr").slice(1).remove();
                        $('#tabProduct8').append(html2);
                        $('#g_money').val(res.data.sanche.g_money);
                        $('#g_hejia').val(res.data.sanche.he_price_gong);
                        $('#g_shijiu').val(res.data.sanche.g_shijiu);
                        $('#g_zongji').val(Number(res.data.sanche.g_money) + Number(res.data.sanche.g_shijiu));
                        $('#heji').val(Number(res.data.sanche.g_money) + Number(res.data.sanche.g_shijiu) + Number(res.data.sanche.p_zongji));
                        $("#hd_g_shijiu").val(res.data.sanche.hd_g_shijiu);
                        $("#hd_g_zongji").val(res.data.sanche.hd_g_zongji);
                        $("#hd_g_heji").val(numAdd(Number(res.data.sanche.hd_p_zongji), numAdd(Number(res.data.sanche.hd_g_zongji), Number(res.data.sanche.hd_g_shijiu))));
                        if (res.data.sancai.length > 0) {
                            for (var i = 0; i < res.data.sancai.length; i++) {
                                html3 += "<tr>" +
                                    "<td><input type='checkbox' readonly style='width: 15px;height: 15px;display: block;' disabled name='id' value=" + res.data.sancai[i].id + "></td>" +
                                    "<td><input type='text' readonly name='xuhao' value=" + res.data.sancai[i].xuhao + "></td>" +
                                    "<td><input type='text' readonly name='type' value=" + res.data.sancai[i].type + "></td>" +
                                    "<td><input type='text' readonly name='name' value=" + res.data.sancai[i].name + "></td>" +
                                    "<td><input type='text' readonly name='fangan' value=" + res.data.sancai[i].fangan + " ></td>" +
                                    "<td><input type='text' readonly name='price' value=" + res.data.sancai[i].price + "></td>" +
                                    "<td><input type='text' readonly name='num'  value=" + res.data.sancai[i].num + "></td>" +
                                    "<td><input type='text' readonly name='money' value=" + res.data.sancai[i].money + " ></td>" +
                                    /* "<td><input type='text' readonly name='zhekou'  value=" + res.data.sancai[i].zhekou + " ></td>" +*/
                                    "<td><input type='text' readonly name='price_he'  value=" + res.data.sancai[i].price_he + "></td>" +
                                    "<td><input type='text' readonly name='num_he'  value=" + res.data.sancai[i].num_he + "></td>" +
                                    "<td><input type='text' readonly name='hejia'  value=" + res.data.sancai[i].hejia + "></td>" +
                                    "<td><input type='text' readonly name='beizhu' value=" + res.data.sancai[i].beizhu + "></td>" +
                                    "</tr>";
                            }
                        } else {
                            html3 += "<tr>" +
                                "<td><input type='checkbox' readonly style='width: 15px;height: 15px;display: block;' disabled name='id' value=''></td>" +
                                "<td><input type='text' name='xuhao' value='1' readonly ></td>" +
                                "<td><input type='text' readonly name='type'></td>" +
                                "<td><input type='text' name='name' readonly></td>" +
                                "<td><input type='text' name='fangan' readonly></td>" +
                                "<td><input type='text' name='price' readonly></td>" +
                                "<td><input type='text' name='num' readonly></td>" +
                                "<td><input type='text' name='money' readonly></td>" +
                                /* "<td><input type='text' name='zhekou' readonly value='100'></td>" +*/
                                "<td><input type='text' name='price_he' readonly value='100'></td>" +
                                "<td><input type='text' name='num_he' readonly value='100'></td>" +
                                "<td><input type='text' name='hejia' readonly></td>" +
                                "<td><input type='text' name='beizhu' readonly></td>" +
                                "</tr>";
                        }
                        $("#tabProduct4 tr").slice(1).remove();
                        $('#tabProduct4').append(html3);
                        $('#c_money').val(res.data.sanche.c_money);
                        $('#c_hejia').val(res.data.sanche.c_hejia);
                        $('#c_heji').val(res.data.sanche.c_heji);
                        $('#c_canzhi').val(res.data.sanche.c_canzhi);
                        $('#c_zongji').val(res.data.sanche.c_zongji);
                        $('#sanche_susong').val(res.data.sanche.sanche_susong);
                        $('#sanche_jianding').val(res.data.sanche.sanche_jianding);
                        $('#sanche_gonggu').val(res.data.sanche.sanche_gonggu);
                        $('#sanche_zhusu').val(res.data.sanche.sanche_zhusu);
                        $('#sanche_luqiao').val(res.data.sanche.sanche_luqiao);
                        $('#sanche_ranyou').val(res.data.sanche.sanche_ranyou);
                        $('#sanche_qita').val(res.data.sanche.sanche_qita);
                        $('#sanche_huizong').val(res.data.sanche.sanche_huizong);
                        $('#beizhu').val(res.data.sanche.beizhu);

                        $('#hd_sanche_susong').val(res.data.sanche.hd_susong_fee);
                        $('#hd_sanche_jianding').val(res.data.sanche.hd_jianding_fee);
                        $('#hd_sanche_gonggu').val(res.data.sanche.hd_gonggu_fee);
                        $('#hd_sanche_zhusu').val(res.data.sanche.hd_zhusu_fee);
                        $('#hd_sanche_luqiao').val(res.data.sanche.hd_luqiao_fee);
                        $('#hd_sanche_ranyou').val(res.data.sanche.hd_ranyou_fee);
                        $('#hd_sanche_qita').val(res.data.sanche.hd_qita_fee);
                        $('#hd_sanche_huizong').val(Number(res.data.sanche.hd_susong_fee)
                            + Number(res.data.sanche.hd_jianding_fee)
                            + Number(res.data.sanche.hd_gonggu_fee)
                            + Number(res.data.sanche.hd_zhusu_fee)
                            + Number(res.data.sanche.hd_luqiao_fee)
                            + Number(res.data.sanche.hd_ranyou_fee)
                            + Number(res.data.sanche.hd_qita_fee)
                        );
                        layer.title('详情', layerIndex); // 修改标题
                        $('#layui-layer' + layerIndex)
                            .find('.layui-layer-content')
                            .empty() // 先清空目标容器
                            .append($('#light').contents());
                    }else{
                        layer.msg(res.msg || '数据加载失败', {icon: 2});
                        layer.close(layerIndex);
                    }
                }
            })

        }

        function numAdd(num1, num2) {
            var baseNum, baseNum1, baseNum2;
            try {
                baseNum1 = num1.toString().split(".")[1].length;
            } catch (e) {
                baseNum1 = 0;
            }
            try {
                baseNum2 = num2.toString().split(".")[1].length;
            } catch (e) {
                baseNum2 = 0;
            }
            baseNum = Math.pow(10, Math.max(baseNum1, baseNum2));
            return ((num1 * baseNum + num2 * baseNum) / baseNum).toFixed(2);
        };

        function jisuan_money3(obj) {
            var sanche_susong = Number($('#sanche_susong').val());
            var sanche_jianding = Number($('#sanche_jianding').val());
            var sanche_gonggu = Number($('#sanche_gonggu').val());
            var sanche_zhusu = Number($('#sanche_zhusu').val());
            var sanche_luqiao = Number($('#sanche_luqiao').val());
            var sanche_ranyou = Number($('#sanche_ranyou').val());
            var sanche_qita = Number($('#sanche_qita').val());

            var total = sanche_susong + sanche_jianding + sanche_gonggu + sanche_zhusu + sanche_luqiao + sanche_ranyou + sanche_qita;
            if (isNaN(total)) total = 0;
            $('#sanche_huizong').val(total.toFixed(2));
        }

    </script>
    {if $lisuan2 != ''}
    {include file="bushen/jiean/lisuan2" /}
    {include file="bushen/jiean/buchangkuan2" /}
    {/if}
</div>